package com.yongxing.pluginappone;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

public class PluginOneActivity extends BaseActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_plugin_one);
//        View viewById = findViewById(R.id.img);
//        Toast.makeText(that, viewById.toString(), Toast.LENGTH_SHORT).show();
//        viewById.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                Toast.makeText(that, "点击跳转页面", Toast.LENGTH_LONG).show();
//                startActivity(new Intent(PluginOneActivity.this, PluginTwoActivity.class));
//            }
//        });
    }

    @Override
    public void onStart() {
        super.onStart();
        View viewById = findViewById(R.id.img);
        Toast.makeText(that, viewById.toString(), Toast.LENGTH_SHORT).show();
        viewById.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(that, "点击跳转页面", Toast.LENGTH_LONG).show();
                startActivity(new Intent(that, PluginTwoActivity.class));
                startService(new Intent(that,PluginOneService.class));

                Intent intent = new Intent();
                intent.setAction("com.yongxing.receiver");
                sendBroadcast(intent);

            }
        });
    }
}
